package com.cn.studySpring.controller;

import javax.naming.AuthenticationException;

import org.apache.ibatis.io.ResolverUtil.Test;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import com.cn.studySpring.pojo.BraveKnight;
import com.cn.studySpring.service.ComPactDisc;
import com.cn.studySpring.service.UserService;
import com.cn.studySpring.util.SpringBeanUtil;

@RequestMapping("/test")
@Controller
public class TestController {

	UserService userService = (UserService) SpringBeanUtil.getBean("userService");
	BraveKnight knight = (BraveKnight) SpringBeanUtil.getBean("knight");
	private static Logger log = Logger.getLogger(Test.class.getClass());

	@RequestMapping(value = "/show", method = RequestMethod.GET)
	public ModelAndView isShow() throws AuthenticationException {
		knight.embarkOnQuest();
		
		return null;
	}
	
	
	@Autowired 
	private ComPactDisc cd;
	/*@RequestMapping(value = "/index8", method = RequestMethod.GET)*/
	//可以往这里面设置一个字符数组,这可以接受打个请求
	@RequestMapping({"/index8","/index9"})
	public ModelAndView index8() throws AuthenticationException {
		cd.play();
		return null;
	}
}

